package cn.wolfcode.service.impl;

import cn.wolfcode.domain.BusinessReport;
import cn.wolfcode.mapper.ConsumptionReportMapper;
import cn.wolfcode.query.BusinessReportQueryObject;
import cn.wolfcode.service.IBusinessReportService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BusinessReportService implements IBusinessReportService {

    @Autowired
    private ConsumptionReportMapper consumptionMapper;


    @Override
    public PageInfo<BusinessReport> list(BusinessReportQueryObject qo) {
        PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize(), qo.getGroupcondition() + " desc");
        List<BusinessReport> list = consumptionMapper.selectBusinessReportDate(qo);
        return new PageInfo<>(list);
    }
}
